﻿using FB.Data.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;

namespace FB.Providers.EmployeeInfo
{
    [Table("emp_EmployeeInPositions")]
    public class EmployeeInPosition : FBAuditModel, IEmployeeInfoEntity
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int ID { get; set; }

        [Required, StringLength(16)]
        [Display(ResourceType = typeof(Resources.Models.EmployeeInPosition), Name = "EMPCode")]
        public string EMPCode { get; set; }

        [Required, StringLength(8)]
        [Display(ResourceType = typeof(Resources.Models.EmployeeInPosition), Name = "COMCode")]
        public string COMCode { get; set; }

        [StringLength(8)]
        [Display(ResourceType = typeof(Resources.Models.EmployeeInPosition), Name = "DEPTCode")]
        public string DEPTCode { get; set; }

        [StringLength(8)]
        [Display(ResourceType = typeof(Resources.Models.EmployeeInPosition), Name = "TEAMCode")]
        public string TEAMCode { get; set; }

        [Required, StringLength(8)]
        [Display(ResourceType = typeof(Resources.Models.EmployeeInPosition), Name = "POSCode")]
        public string POSCode { get; set; }

        [StringLength(256)]
        [Display(ResourceType = typeof(Resources.Models.EmployeeInPosition), Name = "CropTitle")]
        public string CropTitle { get; set; }

        [Display(ResourceType = typeof(Resources.Models.EmployeeInPosition), Name = "IsPrimary")]
        public bool IsPrimary { get; set; }


        [ForeignKey("EMPCode")]
        public virtual Employee Employee { get; set; }

        [ForeignKey("COMCode")]
        public virtual Company Company { get; set; }

        [ForeignKey("POSCode")]
        public virtual Position Position { get; set; }

        [ForeignKey("DEPTCode")]
        public virtual Department Department { get; set; }

        [ForeignKey("TEAMCode")]
        public virtual Team Team { get; set; }        
    }
}
